from django.db import models

# Create your models here.
class Movies(models.Model):
    id = models.AutoField('id',primary_key=True)
    detailLink = models.CharField(verbose_name='详情链接', max_length=255, default='')
    rate = models.CharField(verbose_name='评分', max_length=255, default='')
    title = models.CharField(verbose_name='电影名', max_length=255, default='')
    cover = models.CharField(verbose_name='封面', max_length=255, default='')
    year = models.CharField(verbose_name='年份', max_length=255, default='')
    types = models.CharField(verbose_name='类型', max_length=255, default='')
    country = models.CharField(verbose_name='国家', max_length=255, default='')
    lang = models.CharField(verbose_name='语言', max_length=255, default='')
    time = models.CharField(verbose_name='时间', max_length=255, default='')
    movieTime = models.CharField(verbose_name='时长', max_length=255, default='')
    comment_len = models.CharField(verbose_name='评论量', max_length=255, default='')
    starts = models.CharField(verbose_name='星级', max_length=255, default='')
    summary = models.CharField(verbose_name='简述', max_length=100000, default='')
    comments = models.CharField(verbose_name='五条评论', max_length=100000, default='')
    imgList = models.CharField(verbose_name='图片链接', max_length=25550, default='')
    movieUrl = models.CharField(verbose_name='视频链接', max_length=2555, default='')
    createTime = models.DateTimeField(verbose_name='创建时间', auto_now_add=True)

    class Meta:
        db_table = 'movies'

class Comments(models.Model):
    id = models.AutoField('id',primary_key=True)
    movieName = models.CharField(verbose_name='电影名', max_length=255, default='')
    commentContent = models.CharField(verbose_name='电影评论', max_length=255, default='')

    class Meta:
        db_table = 'comments'

class User(models.Model):
    id = models.AutoField('id', primary_key=True)
    username = models.CharField(verbose_name='用户名', max_length=255, default='')
    password = models.CharField(verbose_name='密码', max_length=255, default='')
    info = models.CharField(verbose_name='个人描述', max_length=255, default='')
    avatar = models.FileField(verbose_name='用户头像', upload_to="avatar", default='avatar/default.png')

    class Meta:
        db_table = 'user'